package com.vip.jwt.controller;


import com.vip.jwt.common.entity.R;
import com.vip.jwt.service.RoleMenuService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 角色菜单关联表 前端控制器
 * </p>
 *
 * @author vip
 * @since 2021-05-04
 */
@RestController
@RequestMapping("/api/role/menu")
public class RoleMenuController {

    @Resource
    private RoleMenuService roleMenuService;

    @GetMapping("/{roleId}")
    public Object findByRoleId(@PathVariable String roleId){
        List<String>[] menuIds = roleMenuService.findByRoleId(roleId);
        return R.ok().data("data",menuIds);
    }

}

